package com.example.controller;


import com.example.entity.Person;
import com.example.entity.vo.VO;
import com.example.service.PersonService;
import com.fasterxml.jackson.databind.util.BeanUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 商品表 前端控制器
 * </p>
 *
 * @author fanbinbing
 * @since 2021-11-30
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {
    @Resource
    private PersonService PersonService;


    @PostMapping("/selectAll")
    public String selectAll(@RequestBody VO vo){

        Person person = new Person();
        BeanUtils.copyProperties(vo,person);
        System.out.println(person);
        PersonService.save(person);
        return person.getPersonName()+person.getPassword();



    }

}

